﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ET.DBCommon.Enum;
using POC.Controls;

namespace RadioStationPOC.Views
{
    /// <summary>
    /// SendCommand.xaml 的交互逻辑
    /// </summary>
    public partial class SendCommand : WindowBase
    {
        public SendCommand()
        {
            InitializeComponent();
        }
        private void GiveUp_Click(object sender, RoutedEventArgs e)
        {
            if (MainWindow.CurMainWindow.CurSystemType == SystemType.ATS)
                (MainWindow.CurMainWindow.LayoutPOC.Children[0] as WirelessTrainUC).GiveUp();
        }

        private void OK_Click(object sender, RoutedEventArgs e)
        {
            if (MainWindow.CurMainWindow.CurSystemType == SystemType.ATS)
                (MainWindow.CurMainWindow.LayoutPOC.Children[0] as WirelessTrainUC).SendCommand(this.txtVoiceText.Text.Trim());
        }

        private void WindowBase_Loaded(object sender, RoutedEventArgs e)
        {
            #region 设置窗体大小及停靠位置
            this.Top = (SystemParameters.PrimaryScreenHeight * 1 - 50) * 0.5;
            if (this.Top <= 0)
            {
                this.Top = 0;
            }
            this.Left = SystemParameters.PrimaryScreenWidth * 0.25 - this.Width / 2;
            if (this.Left <= 0)
            {
                this.Left = 0;
            }
            #endregion
        }
    }
}
